package com.tanhua.server.controller;


import com.tanhua.server.service.SendSoundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/peachblossom")
public class SendSoundController {

        @Autowired
        private SendSoundService sendSoundService;


        /**
         * 发送语音
         * @param soundFile
         * @return
         */
        @PostMapping
        public Object sendVoice(MultipartFile soundFile){
               return sendSoundService.sendSound(soundFile);
        }

        /**
         * 接收语音
         * @return
         */
        @GetMapping
        public Object getVoice(){
                return this.sendSoundService.getSound();
        }

}
